import React from 'react';
import { FloatButton } from 'antd';
import { ReactComponent as RobotIcon } from '@/assets/images/icons/RobotIcon.svg';

export default function AssistantIcon({ iconStyle, onDrag, onDragEnd, onClick }) {
    return (
        <div
            className="smart-assistant"
            draggable
            style={{
                position: 'fixed',
                cursor: 'move',
                zIndex: 1000,
            }}
            onDragStart={(e) => e.dataTransfer.setDragImage(new Image(), 0, 0)}
            onDrag={onDrag}
            onDragEnd={onDragEnd}
        >
            <FloatButton
                icon={
                    <div
                        style={{
                            display: 'flex',
                            justifyContent: 'center',
                            alignItems: 'center',
                            width: '100%',
                            height: '100%',
                        }}
                        onClick={onClick}
                    >
                        <RobotIcon style={iconStyle} />
                    </div>
                }
                tooltip="智能助手"
                size="large"
                style={{
                    width: 64,
                    height: 64,
                    display: 'flex',
                    alignItems: 'center',
                }}
            />
        </div>
    );
}
